<?php

namespace Laoha\Nav;

use Encore\Admin\Admin;
use Encore\Admin\Extension;

class Nav extends Extension
{
    public $name = 'nav';

    public $views = __DIR__.'/../resources/views';

    public $assets = __DIR__.'/../resources/assets';



    public static function boot()
    {
        static::registerRoutes();
        Admin::extend('laoha-nav', __CLASS__);
    }

    protected static function registerRoutes()
    {
        parent::routes(function ($router) {
            /* @var \Illuminate\Routing\Router $router */
            $router->resource('laoha/nav', 'Laoha\Nav\NavController')->names('admin.laoha.nav');
        });
    }

    public static function import()
    {
        parent::createMenu('Nav Manager', 'laoha/nav', 'fa-compass');
        parent::createPermission('Nav Manager', 'laoha.nav', 'laoha/nav*');
    }
}